<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">积分商品列表</strong></div>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label>名称</label> <input type="text" class="am-form-field" ng-model="name">
        </div>
        <button type="submit" class="am-btn am-btn-primary" ng-click="search()">搜索</button>
    </form>
    <br>
    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-add', width: 800, height: 450}" ng-click="splashAddinit"><span class="am-icon-plus"></span> 新增</button>
        <!--<button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>-->
    </div>
    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <th class="table-title">商品ID</th>
                    <th class="table-title">商品名称</th>
                    <th class="table-title">商品描述</th>
                    <th class="table-title">库存</th>
                    <th class="table-title">价格</th>
                    <th class="table-title">图片</th>
                    <th class="table-title">创建时间</th>
                    <th class="table-title">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="scoreShop in scoreShopList" id = "{{scoreShop.id}}">
                    <td class="table-check"><input type="checkbox" class = "item-check"></td>
                    <td>{{scoreShop.id}}</td>
                    <td>{{scoreShop.product_name}}</td>
                    <td>{{scoreShop.product_desc}}</td>
                    <td>{{scoreShop.inventory_level}}</td>
                    <td>{{scoreShop.price}}</td>
                    <td><img ng-show="scoreShop.images!=null" ng-src="{{scoreShop.images}}" width="100" onerror="this.style.display='none'"></td>
                    <td>{{scoreShop.create_time | date:'yyyy-MM-dd HH:mm:ss'}}</td>

                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" data-am-modal="{target: '#doc-modal-edit', width: 800, height: 450}" ng-click="scoreShopEdit(scoreShop)" ><span class="am-icon-copy"></span> 编辑</button>
                                <!--<button type="button" class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="scoreShopStatus(scoreShop)" >上架</button>-->
                                <!--<button type="button" class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="scoreShopStatus(scoreShop)" >下架</button>-->
                            </div>
                        </div>

                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>

    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>

    <!--新增框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">新增积分策略
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div style = "width: 90%;" class = "text-left">
                    <form>
                        <div><label>商品名称</label><input type="text" class = "modal-input" ng-model="addData.name"></div>
                        <div><label>商品描述</label><input type="text" class = "modal-input" ng-model="addData.desc"></div>
                        <div><label>库存</label><input type="text" class = "modal-input" ng-model="addData.inventory"></div>
                        <div><label>商品价格</label><input type="text" class = "modal-input" ng-model="addData.price"></div>
                        <!--<div><label>商品图片</label><input type="text" class = "modal-input" ng-model="addData.item_value_limit_month"></div>-->
                        <div class="form-group">
                            <label class="control-label"  style="width:200px" for="textinput">商品图片(最多可上传1张):</label>
                            <input type="file" id="images_upload"
                                   onchange="angular.element(this).scope().selectFile(this.files,'add')" multiple accept="image/*">
                            <div id="image_result" class="image-result"></div>
                        </div>
                    </form>
                </div>
            </div>
            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="add(addData)">保存</button>
            </div>
        </div>
    </div>

    <!--编辑-->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-edit">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">更新积分策略
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div style = "width: 90%;" class = "text-left">
                    <form>
                        <div><label>商品ID</label><input type="text" class = "modal-input" ng-model="editData.id" disabled="disabled"></div>
                        <div><label>商品名称</label><input type="text" class = "modal-input" ng-model="editData.name"></div>
                        <div><label>商品描述</label><input type="text" class = "modal-input" ng-model="editData.desc"></div>
                        <div><label>库存</label><input type="text" class = "modal-input" ng-model="editData.inventory"></div>
                        <div><label>商品价格</label><input type="text" class = "modal-input" ng-model="editData.price"></div>
                        <div><img ng-show="editData.images!=null" width=100">
                        </div>                        <!--<div><label>商品图片</label><input type="text" class = "modal-input" ng-model="addData.item_value_limit_month"></div>-->
                        <div class="form-group">
                            <label class="control-label"  style="width:200px" for="textinput">商品图片(最多可上传1张):</label>
                            <input type="file" id="images_upload_edit"
                                   onchange="angular.element(this).scope().selectFile(this.files,'scoreShopUpdate')" multiple accept="image/*">
                            <div id="image_result_edit" class="image-result"></div>
                        </div>
                    </form>
                </div>
            </div>
            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="scoreShopUpdate(editData)">保存</button>
            </div>
        </div>
    </div>
</div>